<!--包含头部文件-->
{include file="public/header" /}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 后台菜单 <span class="c-gray en">&gt;</span> 菜单列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-10">
        <!--<span class="l">-->
            <!--<a href="javascript:;" onclick="shop_add('新增菜单','shop_add.html',$(window).width(),$(window).height())" class="btn btn-primary radius">-->
                <!--<i class="Hui-iconfont">&#xe600;</i>-->
                <!--新增菜单-->
            <!--</a>-->
        <!--</span>-->

        <div class="panel panel-default">
            <div class="panel-header">授权账号信息</div>
            <div class="panel-body">
                <div class="am-margin-bottom">
                    <img class="am-margin-right-sm" style="width: 50px;float: left; margin-right: 1rem;" src="//wwc.alicdn.com/avatar/getAvatar.do?userId=642623368&width=160&height=160&type=sns">
                    <span style="color: #F37B1D;">freytaobao</span>
                    <br>
                    <span style="font-size: 1.4rem;">
						<span>授权到期时间：</span>
						2018-06-06 15:17:39 <a href="#" class="toauth">更新授权</a>
					</span>
                </div>
            </div>
        </div>

    </div>

    <div class="row">
        <div class="col-sm-2" id="pageBox">

        </div>
    </div>
</div>
<!--包含footer文件-->
{include file="public/footer" /}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    /*
     参数解释：
     title 标题
     url      请求的url
     id       需要操作的数据id
     w    弹出层宽度（缺省调默认值）
     h    弹出层高度（缺省调默认值）
     */
    /*店铺-增加*/
    function shop_add(title,url,w,h){
        layer_show(title,url,w,h);
    }
    /*店铺-删除*/
    function admin_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: '',
                dataType: 'json',
                success: function(data){
                    $(obj).parents("tr").remove();
                    layer.msg('已删除!',{icon:1,time:1000});
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });

        });
    }

    /*店铺-编辑*/
    function admin_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /*店铺-停用*/
    function admin_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……
            $.post("admin/change_admin",'',function(result){
                console.log(result)
            });

            $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_start(this,id)" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">已禁用</span>');
            $(obj).remove();
            layer.msg('已停用!',{icon: 5,time:1000});
        });
    }

    /*管理员-启用*/
    function admin_start(obj,id){
        layer.confirm('确认要启用吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……


            $(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_stop(this,id)" href="javascript:;" title="停用" style="text-decoration:none"><i class="Hui-iconfont">&#xe631;</i></a>');
            $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
            $(obj).remove();
            layer.msg('已启用!', {icon: 6,time:1000});
        });
    }
    $(function () {
        $('.toauth').click(function () {
            layer_show('授权登录','https://oauth.taobao.com/authorize?response_type=code&client_id=24635648&redirect_uri=http://admin.vipbuy360.com/index/callback/tbauth/&state=1212&view=web',1000,800);
        })
    })
</script>
</body>
</html>
